#pragma once
#include "SCoreStd.h"

struct P3CVERTEX
{
	D3DXVECTOR3		vp;
	D3DCOLOR		vc;
	enum {  FVF = ( D3DFVF_XYZ | D3DFVF_DIFFUSE )};
};

class SDebug
{
public :
	P3CVERTEX	m_LineVert[2];
	P3CVERTEX	m_TrianglerVert[6];
	P3CVERTEX	m_PlanerVert[8];
	P3CVERTEX	m_BoundBoxVert[24];
	LPDIRECT3DDEVICE9	m_pd3dDevice;

public :
	void			DrawLine(	LPDIRECT3DDEVICE9	pd3dDevice,
								D3DXVECTOR3 p0,
								D3DXVECTOR3 p1,
								D3DCOLOR vc = 0xffff0000 );

	void			DrawTriangle(	LPDIRECT3DDEVICE9	pd3dDevice,
									D3DXVECTOR3 p0,
									D3DXVECTOR3 p1,
									D3DXVECTOR3 p2,
									D3DXVECTOR3 p3,
									D3DXVECTOR3 p4,
									D3DXVECTOR3 p5,
									D3DCOLOR vc = 0xffff0000 );
	void			DrawBoundBox( D3DXVECTOR3 Max, D3DXVECTOR3 Min, 
		                           LPDIRECT3DDEVICE9	pd3dDevice, D3DCOLOR color = 0x00ff0000 );

	void			BeginRender( LPDIRECT3DDEVICE9 m_pd3dDevice, D3DCOLOR color=0xffff0000 );
//	void			BeginRender( LPDIRECT3DDEVICE9	pd3dDevice, DWORD dwColor );
	void			SetBoundBox( D3DXVECTOR3*	Quad );
	void			EndRender( LPDIRECT3DDEVICE9	pd3dDevice );


	bool			Init();
	bool			Frame();
	bool			Render();
	bool			Release();

public:
	SDebug(void);
	~SDebug(void);
};
